package com.blog.test.singleton;


/**
 * 通过静态内部类实现单例模式
 * 这种方式：线程安全，调用效率高，并且实现了延迟加载！
 * @author user
 *
 */
public class SingletonDemo3 {
	 
	private SingletonDemo3(){
		
	}
	
	private static class SingletonDemoInstance {
		private static final SingletonDemo3 instance=new SingletonDemo3();
	}
	
	public static SingletonDemo3 getInstance(){
		return SingletonDemoInstance.instance;
	}
	
}
